import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginPage from '../views/back-stage-management/login/LoginPage.vue'
import Home from '../views/back-stage-management/homepage/Home.vue'

Vue.use(VueRouter)

const routes = [
  // 登录页面
  {
    path: "/",
    name: "loginpage",
    component: LoginPage
  },
  // 首页
  {
    path: "/home",
    name: "home",
    component: Home,
    redirect:"/admininformanage",
    children: [
    {
      // 不写路径 默认为父路由第一渲染,或者重定向
      // 管理员信息管理
      path: "/admininformanage",
      name: "AdminInforManage",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/AdminInforManage.vue")

    },{
    //  用户信息管理
      path: "/userinformanage",
      name: "UserInforManage",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/UserInforManage.vue")

    },{
      // 个人信息管理
      path: "/perinformanage",
      name: "PerInforManage",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/PerInforManage.vue")

    },{
      // 宠物信息管理
      path: "/petinformanage",
      name: "PetInforManage",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/PetInforManage.vue")

    },{
      // 宠物分类
      path: "/petclassification",
      name: "PetClassification",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/PetClassification.vue")

    },{
      // 领养申请
      path: "/applyadoption",
      name: "ApplyAdoption",
      component: ()=>import("../views/back-stage-management/homepage/HomeRouter/ApplyAdoption.vue")

    }
  ]
  }

]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router